<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>Document</title>
        <script src="../vue.js"></script>
    </head>
    <body>
        <div id="app">
            <button @click="handleClick">按钮{{nowDate}}</button>
        </div>
        <div id="vm">
            <button @click="handleClick">按钮{{nowDate}}</button>
        </div>
        <script>
            // 全局混入
            Vue.mixin({
                data() {
                    return {
                        nowDate: '2021-05-25',
                    };
                },
                methods: {
                    handleClick() {
                        console.log('this is page');
                    },
                },
            });
            let mx = {
                data() {
                    return {
                        nowDate: '2021-05-25',
                    };
                },
                methods: {
                    handleClick() {
                        console.log('this is page');
                    },
                },
            };
            let vm = new Vue({
                el: '#app',
                data() {
                    return { nowDate: '2021-05-26' };
                },
                methods: {
                    handleClick() {
                        console.log('this is page!', '==组件本身==');
                    },
                },
                // mixins: [mx],
            });
            new Vue({
                el: '#vm',
                // mixins: [mx],
                methods: {
                    // handleClick() {
                    //     console.log('this is page');
                    // },
                },
            });
        </script>
    </body>
</html>
